
#ifndef Lines_SpriteEffect_h
#define Lines_SpriteEffect_h

#include "RenderableEntity.h"

enum eEaseMode { EASE_NONE, EASE, EASE_IN, EASE_OUT };

class SpriteEffect
{
protected:
    RenderableEntity* m_entity;
    
	eEaseMode m_eEaseMode;
	
    bool m_bEnabled;
    bool m_bLoop;
    float m_fDuration;
    
    float m_fElapsedTime;
    
    float m_fSpeed;
    
protected:    
    virtual void updateEffect(float _fPerc) = 0;
	virtual void enableEffect(bool _bValue){};

public:
    SpriteEffect(RenderableEntity* _entity, float _fduration, bool _bEnabled = false, bool _bLoop = false);
    
    void start(bool _bReset = false);
    void update(float dt);
    void reset();
    bool isFinished();

    void setEnabled(bool _bEnabled);
    bool isEnabled();

    void setDuration(float _fDuration);
    float getDuration();
    
    void setLoop(bool _bLoop);
    bool isLoop();
    
    void setSpeed(float _fSpeed);	

	void setEaseMode(eEaseMode _eEaseMode);

protected:
	float getPerc(float t);
	float ease(float T);
	float easeOut(float T);
	float easeIn(float T);

};

#endif
